package com.bittech.wiki_learn.config;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;

@SpringBootApplication
// 默认扫描启动类包以及子包下的所有Bean，当需要指定扫描包时添加此注解，并可以通过列表的形式添加多个包
@ComponentScan("com.bittech.wiki_learn")
// 定义持久层接口扫描包位置
@MapperScan("com.bittech.wiki_learn.mapper")
public class WikiLearnApplication {
    private static final Logger LOG = LoggerFactory.getLogger(WikiLearnApplication.class);
    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(WikiLearnApplication.class);
        Environment env = app.run(args).getEnvironment();
        LOG.info("启动成功！！");
        LOG.info("地址: \thttp://127.0.0.1:{}", env.getProperty("server.port"));
    }

}
